<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>VFMADD132SD/VFMADD213SD/VFMADD231SD—Fused Multiply-Add of Scalar Double-Precision Floating-Point Values </title></head>
<body>
<h1>VFMADD132SD/VFMADD213SD/VFMADD231SD—Fused Multiply-Add of Scalar Double-Precision Floating-Point Values</h1>
<table>
<tr>
<th>Opcode/Instruction</th>
<th>Op/En</th>
<th>64/32 bit Mode Support</th>
<th>CPUID Feature Flag</th>
<th>Description</th></tr>
<tr>
<td>
<p>VEX.DDS.LIG.66.0F38.W1 99 /r</p>
<p>VFMADD132SD xmm1, xmm2, xmm3/m64</p></td>
<td>RVM</td>
<td>V/V</td>
<td>FMA</td>
<td>Multiply scalar double-precision floating-point value from xmm1 and xmm3/m64, add to xmm2 and put result in xmm1.</td></tr>
<tr>
<td>
<p>VEX.DDS.LIG.66.0F38.W1 A9 /r</p>
<p>VFMADD213SD xmm1, xmm2, xmm3/m64</p></td>
<td>RVM</td>
<td>V/V</td>
<td>FMA</td>
<td>Multiply scalar double-precision floating-point value from xmm1 and xmm2, add to xmm3/m64 and put result in xmm1.</td></tr>
<tr>
<td>
<p>VEX.DDS.LIG.66.0F38.W1 B9 /r</p>
<p>VFMADD231SD xmm1, xmm2, xmm3/m64</p></td>
<td>RVM</td>
<td>V/V</td>
<td>FMA</td>
<td>Multiply scalar double-precision floating-point value from xmm2 and xmm3/m64, add to xmm1 and put result in xmm1.</td></tr>
<tr>
<td>
<p>EVEX.DDS.LIG.66.0F38.W1 99 /r</p>
<p>VFMADD132SD xmm1 {k1}{z}, xmm2, xmm3/m64{er}</p></td>
<td>T1S</td>
<td>V/V</td>
<td>AVX512F</td>
<td>Multiply scalar double-precision floating-point value from xmm1 and xmm3/m64, add to xmm2 and put result in xmm1.</td></tr>
<tr>
<td>
<p>EVEX.DDS.LIG.66.0F38.W1 A9 /r</p>
<p>VFMADD213SD xmm1 {k1}{z}, xmm2, xmm3/m64{er}</p></td>
<td>T1S</td>
<td>V/V</td>
<td>AVX512F</td>
<td>Multiply scalar double-precision floating-point value from xmm1 and xmm2, add to xmm3/m64 and put result in xmm1.</td></tr>
<tr>
<td>
<p>EVEX.DDS.LIG.66.0F38.W1 B9 /r</p>
<p>VFMADD231SD xmm1 {k1}{z}, xmm2, xmm3/m64{er}</p></td>
<td>T1S</td>
<td>V/V</td>
<td>AVX512F</td>
<td>Multiply scalar double-precision floating-point value from xmm2 and xmm3/m64, add to xmm1 and put result in xmm1.</td></tr></table>
<h3>Instruction Operand Encoding</h3>
<table>
<tr>
<td>Op/En</td>
<td>Operand 1</td>
<td>Operand 2</td>
<td>Operand 3</td>
<td>Operand 4</td></tr>
<tr>
<td>RVM</td>
<td>ModRM:reg (r, w)</td>
<td>VEX.vvvv (r)</td>
<td>ModRM:r/m (r)</td>
<td>NA</td></tr>
<tr>
<td>T1S</td>
<td>ModRM:reg (r, w)</td>
<td>EVEX.vvvv (r)</td>
<td>ModRM:r/m (r)</td>
<td>NA</td></tr></table>
<p><strong>Description</strong></p>
<p>Performs a SIMD multiply-add computation on the low double-precision floating-point values using three source operands and writes the multiply-add result in the destination operand. The destination operand is also the first source operand. The first and second operand are XMM registers. The third source operand can be an XMM register or a 64-bit memory location.</p>
<p>VFMADD132SD: Multiplies the low double-precision floating-point value from the first source operand to the low double-precision floating-point value in the third source operand, adds the infinite precision intermediate result to the low double-precision floating-point values in the second source operand, performs rounding and stores the resulting double-precision floating-point value to the destination operand (first source operand).</p>
<p>VFMADD213SD: Multiplies the low double-precision floating-point value from the second source operand to the low double-precision floating-point value in the first source operand, adds the infinite precision intermediate result to the low double-precision floating-point value in the third source operand, performs rounding and stores the resulting double-precision floating-point value to the destination operand (first source operand).</p>
<p>VFMADD231SD: Multiplies the low double-precision floating-point value from the second source to the low double-precision floating-point value in the third source operand, adds the infinite precision intermediate result to the low double-precision floating-point value in the first source operand, performs rounding and stores the resulting double-precision floating-point value to the destination operand (first source operand).</p>
<p>VEX.128 and EVEX encoded version: The destination operand (also first source operand) is encoded in reg_field. The second source operand is encoded in VEX.vvvv/EVEX.vvvv. The third source operand is encoded in rm_field. Bits 127:64 of the destination are unchanged. Bits MAXVL-1:128 of the destination register are zeroed.</p>
<p>EVEX encoded version: The low quadword element of the destination is updated according to the writemask.</p>
<p><strong>Operation</strong></p>
<p>In the operations below, “*” and “+” symbols represent multiplication and addition with infinite precision inputs and outputs (no rounding).</p>
<p><strong>VFMADD132SD DEST, SRC2, SRC3 (EVEX encoded version)</strong></p>
<p>IF (EVEX.b = 1) and SRC3 *is a register*</p>
<p>THEN</p>
<p>SET_RM(EVEX.RC);</p>
<p>ELSE</p>
<p>SET_RM(MXCSR.RM);</p>
<p>FI;</p>
<p>IF k1[0] or *no writemask*</p>
<p>THEN</p>
<p>DEST[63:0] (cid:197) RoundFPControl(DEST[63:0]*SRC3[63:0] + SRC2[63:0])</p>
<p>ELSE</p>
<p>IF *merging-masking*</p>
<p>; merging-masking</p>
<p>THEN *DEST[63:0] remains unchanged*</p>
<p>ELSE</p>
<p>; zeroing-masking</p>
<p>THEN DEST[63:0] (cid:197) 0</p>
<p>FI;</p>
<p>FI;</p>
<p>DEST[127:64] (cid:197) DEST[127:64]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>VFMADD213SD DEST, SRC2, SRC3 (EVEX encoded version)</strong></p>
<p>IF (EVEX.b = 1) and SRC3 *is a register*</p>
<p>THEN</p>
<p>SET_RM(EVEX.RC);</p>
<p>ELSE</p>
<p>SET_RM(MXCSR.RM);</p>
<p>FI;</p>
<p>IF k1[0] or *no writemask*</p>
<p>THEN</p>
<p>DEST[63:0] (cid:197) RoundFPControl(SRC2[63:0]*DEST[63:0] + SRC3[63:0])</p>
<p>ELSE</p>
<p>IF *merging-masking*</p>
<p>; merging-masking</p>
<p>THEN *DEST[63:0] remains unchanged*</p>
<p>ELSE</p>
<p>; zeroing-masking</p>
<p>THEN DEST[63:0] (cid:197) 0</p>
<p>FI;</p>
<p>FI;</p>
<p>DEST[127:64] (cid:197) DEST[127:64]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>VFMADD231SD DEST, SRC2, SRC3 (EVEX encoded version)</strong></p>
<p>IF (EVEX.b = 1) and SRC3 *is a register*</p>
<p>THEN</p>
<p>SET_RM(EVEX.RC);</p>
<p>ELSE</p>
<p>SET_RM(MXCSR.RM);</p>
<p>FI;</p>
<p>IF k1[0] or *no writemask*</p>
<p>THEN</p>
<p>DEST[63:0] (cid:197) RoundFPControl(SRC2[63:0]*SRC3[63:0] + DEST[63:0])</p>
<p>ELSE</p>
<p>IF *merging-masking*</p>
<p>; merging-masking</p>
<p>THEN *DEST[63:0] remains unchanged*</p>
<p>ELSE</p>
<p>; zeroing-masking</p>
<p>THEN DEST[63:0] (cid:197) 0</p>
<p>FI;</p>
<p>FI;</p>
<p>DEST[127:64] (cid:197) DEST[127:64]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>VFMADD132SD DEST, SRC2, SRC3 (VEX encoded version)</strong></p>
<p>DEST[63:0] (cid:197) MAX_VL-1:128RoundFPControl_MXCSR(DEST[63:0]*SRC3[63:0] + SRC2[63:0])</p>
<p>DEST[127:63] (cid:197) DEST[127:63]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>VFMADD213SD DEST, SRC2, SRC3 (VEX encoded version)</strong></p>
<p>DEST[63:0] (cid:197) RoundFPControl_MXCSR(SRC2[63:0]*DEST[63:0] + SRC3[63:0])</p>
<p>DEST[127:63] (cid:197) DEST[127:63]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>VFMADD231SD DEST, SRC2, SRC3 (VEX encoded version)</strong></p>
<p>DEST[63:0] (cid:197) RoundFPControl_MXCSR(SRC2[63:0]*SRC3[63:0] + DEST[63:0])</p>
<p>DEST[127:63] (cid:197) DEST[127:63]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p><strong>Intel C/C++ Compiler Intrinsic Equivalent</strong></p>
<p>VFMADDxxxSD __m128d _mm_fmadd_round_sd(__m128d a, __m128d b, __m128d c, int r);</p>
<p>VFMADDxxxSD __m128d _mm_mask_fmadd_sd(__m128d a, __mmask8 k, __m128d b, __m128d c);</p>
<p>VFMADDxxxSD __m128d _mm_maskz_fmadd_sd(__mmask8 k, __m128d a, __m128d b, __m128d c);</p>
<p>VFMADDxxxSD __m128d _mm_mask3_fmadd_sd(__m128d a, __m128d b, __m128d c, __mmask8 k);</p>
<p>VFMADDxxxSD __m128d _mm_mask_fmadd_round_sd(__m128d a, __mmask8 k, __m128d b, __m128d c, int r);</p>
<p>VFMADDxxxSD __m128d _mm_maskz_fmadd_round_sd(__mmask8 k, __m128d a, __m128d b, __m128d c, int r);</p>
<p>VFMADDxxxSD __m128d _mm_mask3_fmadd_round_sd(__m128d a, __m128d b, __m128d c, __mmask8 k, int r);</p>
<p>VFMADDxxxSD __m128d _mm_fmadd_sd (__m128d a, __m128d b, __m128d c);</p>
<p><strong>SIMD Floating-Point Exceptions</strong></p>
<p>Overflow, Underflow, Invalid, Precision, Denormal</p>
<p><strong>Other Exceptions</strong></p>
<table>
<tr>
<td>VEX-encoded instructions, see Exceptions Type 3.</td></tr>
<tr>
<td>EVEX-encoded instructions, see Exceptions Type E3.</td></tr></table></body></html>